<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编辑帖子</title>
    <link href="{{ url_for('static', filename='front/css/bootstrap-3.3.7.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='front/css/wangEditor.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='front/css/wangeditorlatest_dist_css_style.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='sweetalert/sweetalert.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='front/css/front_base.css') }}" rel="stylesheet">

    <script src="{{ url_for('static', filename='front/js/jquery-3.1.1.min.js') }}"></script>
    <script src="{{ url_for('static', filename='front/js/wangeditor_latest_dist_index.js') }}"></script>
    <script src="{{ url_for('static', filename='front/js/csrf_ajax.js') }}"></script>
    <script src="{{ url_for("static", filename="sweetalert/sweetalert.min.js") }}"></script>
    <script src="{{ url_for("static", filename="sweetalert/xtalert.js") }}"></script>
    <script src="{{ url_for('static', filename='front/js/bootstrap-3.3.7.min.js') }}"></script>
    <script src="{{ url_for('static', filename='front/js/edit_post.js') }}"></script>

</head>
<body>
<div class="main-container">
    <h1 style="text-align: center; padding: 20px;">修改帖子</h1>
    <form action="" method="post">
        <div class="form-group">
            <div class="input-group">
                <span class="input-group-addon">标题</span>
                <input type="text" class="form-control" name="title" value="{{ post.title }}" data-post-id="{{ post.id }}">
            </div>
        </div>
        <div class="form-group">
            <div class="input-group">
                <span class="input-group-addon">板块</span>
                <select name="board_id" class="form-control">
                    {% for board in boards %}
                        <option value="{{ board.id }}"
                                {% if board.id == post.board_id %}selected{% endif %}>{{ board.name }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
        <div class="form-group">
            <div id="editor—wrapper">
                <div id="toolbar-container"><!-- 工具栏 --></div>
                <div id="editor-container" data-post-content="{{ post.content }}"><!-- 编辑器 --></div>
            </div>
        </div>
        <div class="form-group">
            <button class="btn btn-primary" id="submit-btn">保存</button>
            <button class="btn btn-default" id="cancel-edit-btn">取消</button>
        </div>
    </form>
</div>
</body>
</html>
